\(\int \frac {\cot ^2(e+f x)}{(a-a \sin ^2(e+f x))^{3/2}} \, dx\) [484]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [B] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [F(-2)]
   Mupad [F(-1)]

Optimal result

Integrand size = 26, antiderivative size = 63 \[ \int \frac {\cot ^2(e+f x)}{\left (a-a \sin ^2(e+f x)\right )^{3/2}} \, dx=\frac {\text {arctanh}(\sin (e+f x)) \cos (e+f x)}{a f \sqrt {a \cos ^2(e+f x)}}-\frac {\cot (e+f x)}{a f \sqrt {a \cos ^2(e+f x)}} \]

[Out]

arctanh(sin(f*x+e))*cos(f*x+e)/a/f/(a*cos(f*x+e)^2)^(1/2)-cot(f*x+e)/a/f/(a*cos(f*x+e)^2)^(1/2)

Rubi [A] (verified)

Time = 0.25 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {3255, 3286, 2701, 327, 213} \[ \int \frac {\cot ^2(e+f x)}{\left (a-a \sin ^2(e+f x)\right )^{3/2}} \, dx=\frac {\cos (e+f x) \text {arctanh}(\sin (e+f x))}{a f \sqrt {a \cos ^2(e+f x)}}-\frac {\cot (e+f x)}{a f \sqrt {a \cos ^2(e+f x)}} \]

[In]

Int[Cot[e + f*x]^2/(a - a*Sin[e + f*x]^2)^(3/2),x]

[Out]

(ArcTanh[Sin[e + f*x]]*Cos[e + f*x])/(a*f*Sqrt[a*Cos[e + f*x]^2]) - Cot[e + f*x]/(a*f*Sqrt[a*Cos[e + f*x]^2])

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2701

Int[(csc[(e_.) + (f_.)*(x_)]*(a_.))^(m_)*sec[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> Dist[-(f*a^n)^(-1), Subst
[Int[x^(m + n - 1)/(-1 + x^2/a^2)^((n + 1)/2), x], x, a*Csc[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && Integer
Q[(n + 1)/2] &&  !(IntegerQ[(m + 1)/2] && LtQ[0, m, n])

Rule 3255

Int[(u_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*cos[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a + b, 0]

Rule 3286

Int[(u_.)*((b_.)*sin[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Sin[e + f*x], x]}, Di
st[(b*ff^n)^IntPart[p]*((b*Sin[e + f*x]^n)^FracPart[p]/(Sin[e + f*x]/ff)^(n*FracPart[p])), Int[ActivateTrig[u]
*(Sin[e + f*x]/ff)^(n*p), x], x]] /; FreeQ[{b, e, f, n, p}, x] &&  !IntegerQ[p] && IntegerQ[n] && (EqQ[u, 1] |
| MatchQ[u, ((d_.)*(trig_)[e + f*x])^(m_.) /; FreeQ[{d, m}, x] && MemberQ[{sin, cos, tan, cot, sec, csc}, trig
]])

Rubi steps \begin{align*} \text {integral}& = \int \frac {\cot ^2(e+f x)}{\left (a \cos ^2(e+f x)\right )^{3/2}} \, dx \\ & = \frac {\cos (e+f x) \int \csc ^2(e+f x) \sec (e+f x) \, dx}{a \sqrt {a \cos ^2(e+f x)}} \\ & = -\frac {\cos (e+f x) \text {Subst}\left (\int \frac {x^2}{-1+x^2} \, dx,x,\csc (e+f x)\right )}{a f \sqrt {a \cos ^2(e+f x)}} \\ & = -\frac {\cot (e+f x)}{a f \sqrt {a \cos ^2(e+f x)}}-\frac {\cos (e+f x) \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\csc (e+f x)\right )}{a f \sqrt {a \cos ^2(e+f x)}} \\ & = \frac {\text {arctanh}(\sin (e+f x)) \cos (e+f x)}{a f \sqrt {a \cos ^2(e+f x)}}-\frac {\cot (e+f x)}{a f \sqrt {a \cos ^2(e+f x)}} \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.

Time = 0.08 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.70 \[ \int \frac {\cot ^2(e+f x)}{\left (a-a \sin ^2(e+f x)\right )^{3/2}} \, dx=-\frac {\cot (e+f x) \operatorname {Hypergeometric2F1}\left (-\frac {1}{2},1,\frac {1}{2},\sin ^2(e+f x)\right )}{a f \sqrt {a \cos ^2(e+f x)}} \]

[In]

Integrate[Cot[e + f*x]^2/(a - a*Sin[e + f*x]^2)^(3/2),x]

[Out]

-((Cot[e + f*x]*Hypergeometric2F1[-1/2, 1, 1/2, Sin[e + f*x]^2])/(a*f*Sqrt[a*Cos[e + f*x]^2]))

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(122\) vs. \(2(59)=118\).

Time = 1.01 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.95

method result size
default \(\frac {\cos \left (f x +e \right ) \sqrt {a \left (\sin ^{2}\left (f x +e \right )\right )}\, \left (-\ln \left (\frac {2 \sqrt {a}\, \sqrt {a \left (\sin ^{2}\left (f x +e \right )\right )}+2 a}{\cos \left (f x +e \right )}\right ) a \left (\sin ^{2}\left (f x +e \right )\right )+\sqrt {a}\, \sqrt {a \left (\sin ^{2}\left (f x +e \right )\right )}\right )}{a^{\frac {5}{2}} \left (1+\cos \left (f x +e \right )\right ) \left (\cos \left (f x +e \right )-1\right ) \sin \left (f x +e \right ) \sqrt {a \left (\cos ^{2}\left (f x +e \right )\right )}\, f}\) \(123\)
risch \(-\frac {2 i \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{a \sqrt {\left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2} a \,{\mathrm e}^{-2 i \left (f x +e \right )}}\, f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )}-\frac {2 \ln \left ({\mathrm e}^{i f x}-i {\mathrm e}^{-i e}\right ) \cos \left (f x +e \right )}{f \sqrt {\left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2} a \,{\mathrm e}^{-2 i \left (f x +e \right )}}\, a}+\frac {2 \ln \left ({\mathrm e}^{i f x}+i {\mathrm e}^{-i e}\right ) \cos \left (f x +e \right )}{f \sqrt {\left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2} a \,{\mathrm e}^{-2 i \left (f x +e \right )}}\, a}\) \(173\)

[In]

int(cot(f*x+e)^2/(a-a*sin(f*x+e)^2)^(3/2),x,method=_RETURNVERBOSE)

[Out]

1/a^(5/2)*cos(f*x+e)*(a*sin(f*x+e)^2)^(1/2)*(-ln(2/cos(f*x+e)*(a^(1/2)*(a*sin(f*x+e)^2)^(1/2)+a))*a*sin(f*x+e)
^2+a^(1/2)*(a*sin(f*x+e)^2)^(1/2))/(1+cos(f*x+e))/(cos(f*x+e)-1)/sin(f*x+e)/(a*cos(f*x+e)^2)^(1/2)/f

Fricas [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.05 \[ \int \frac {\cot ^2(e+f x)}{\left (a-a \sin ^2(e+f x)\right )^{3/2}} \, dx=-\frac {\sqrt {a \cos \left (f x + e\right )^{2}} {\left (\log \left (-\frac {\sin \left (f x + e\right ) - 1}{\sin \left (f x + e\right ) + 1}\right ) \sin \left (f x + e\right ) + 2\right )}}{2 \, a^{2} f \cos \left (f x + e\right ) \sin \left (f x + e\right )} \]

[In]

integrate(cot(f*x+e)^2/(a-a*sin(f*x+e)^2)^(3/2),x, algorithm="fricas")

[Out]

-1/2*sqrt(a*cos(f*x + e)^2)*(log(-(sin(f*x + e) - 1)/(sin(f*x + e) + 1))*sin(f*x + e) + 2)/(a^2*f*cos(f*x + e)
*sin(f*x + e))

Sympy [F]

\[ \int \frac {\cot ^2(e+f x)}{\left (a-a \sin ^2(e+f x)\right )^{3/2}} \, dx=\int \frac {\cot ^{2}{\left (e + f x \right )}}{\left (- a \left (\sin {\left (e + f x \right )} - 1\right ) \left (\sin {\left (e + f x \right )} + 1\right )\right )^{\frac {3}{2}}}\, dx \]

[In]

integrate(cot(f*x+e)**2/(a-a*sin(f*x+e)**2)**(3/2),x)

[Out]

Integral(cot(e + f*x)**2/(-a*(sin(e + f*x) - 1)*(sin(e + f*x) + 1))**(3/2), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 220 vs. \(2 (59) = 118\).

Time = 0.38 (sec) , antiderivative size = 220, normalized size of antiderivative = 3.49 \[ \int \frac {\cot ^2(e+f x)}{\left (a-a \sin ^2(e+f x)\right )^{3/2}} \, dx=\frac {{\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} - 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )} \log \left (\cos \left (f x + e\right )^{2} + \sin \left (f x + e\right )^{2} + 2 \, \sin \left (f x + e\right ) + 1\right ) - {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} - 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )} \log \left (\cos \left (f x + e\right )^{2} + \sin \left (f x + e\right )^{2} - 2 \, \sin \left (f x + e\right ) + 1\right ) - 4 \, \cos \left (f x + e\right ) \sin \left (2 \, f x + 2 \, e\right ) + 4 \, \cos \left (2 \, f x + 2 \, e\right ) \sin \left (f x + e\right ) - 4 \, \sin \left (f x + e\right )}{2 \, {\left (a \cos \left (2 \, f x + 2 \, e\right )^{2} + a \sin \left (2 \, f x + 2 \, e\right )^{2} - 2 \, a \cos \left (2 \, f x + 2 \, e\right ) + a\right )} \sqrt {a} f} \]

[In]

integrate(cot(f*x+e)^2/(a-a*sin(f*x+e)^2)^(3/2),x, algorithm="maxima")

[Out]

1/2*((cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 - 2*cos(2*f*x + 2*e) + 1)*log(cos(f*x + e)^2 + sin(f*x + e)^2 +
2*sin(f*x + e) + 1) - (cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 - 2*cos(2*f*x + 2*e) + 1)*log(cos(f*x + e)^2 +
sin(f*x + e)^2 - 2*sin(f*x + e) + 1) - 4*cos(f*x + e)*sin(2*f*x + 2*e) + 4*cos(2*f*x + 2*e)*sin(f*x + e) - 4*s
in(f*x + e))/((a*cos(2*f*x + 2*e)^2 + a*sin(2*f*x + 2*e)^2 - 2*a*cos(2*f*x + 2*e) + a)*sqrt(a)*f)

Giac [F(-2)]

Exception generated. \[ \int \frac {\cot ^2(e+f x)}{\left (a-a \sin ^2(e+f x)\right )^{3/2}} \, dx=\text {Exception raised: TypeError} \]

[In]

integrate(cot(f*x+e)^2/(a-a*sin(f*x+e)^2)^(3/2),x, algorithm="giac")

[Out]

Exception raised: TypeError >> an error occurred running a Giac command:INPUT:sage2:=int(sage0,sageVARx):;OUTP
UT:index.cc index_m i_lex_is_greater Error: Bad Argument Value

Mupad [F(-1)]

Timed out. \[ \int \frac {\cot ^2(e+f x)}{\left (a-a \sin ^2(e+f x)\right )^{3/2}} \, dx=\int \frac {{\mathrm {cot}\left (e+f\,x\right )}^2}{{\left (a-a\,{\sin \left (e+f\,x\right )}^2\right )}^{3/2}} \,d x \]

[In]

int(cot(e + f*x)^2/(a - a*sin(e + f*x)^2)^(3/2),x)

[Out]

int(cot(e + f*x)^2/(a - a*sin(e + f*x)^2)^(3/2), x)